<template>
  <el-dialog title="查看退换货详情" :visible.sync="dialogVisible" width="1000px" :close-on-click-modal="false"
    :modal-append-to-body="false" v-drag2anywhere>
      <el-table :data="tableData" border>
        <el-table-column label="序号" type="index"></el-table-column>

        <el-table-column label="产品名称" prop="title"></el-table-column>
        <el-table-column label="规格型号" prop="model" align="center" width="100"></el-table-column>
        <el-table-column label="退款金额" prop="amount" width="90" align="center"></el-table-column>
        <el-table-column label="退货换类型" align="center" width="90">
          <template v-slot="scope">
            <span v-if="scope.row.type=='1'">仅退款</span>
            <span v-if="scope.row.type=='2'">仅退货</span>
            <span v-if="scope.row.type=='3'">退货退款</span>
            <span v-if="scope.row.type=='4'">换货</span>
            <span v-if="scope.row.type=='5'">优惠返点</span>
          </template>
        </el-table-column>
        <el-table-column label="状态" prop="status" width="80" align="center">
          <template v-slot="scope">
            <span v-if="scope.row.status=='0'" style="background-color: #FF0000; color: #FFF; padding: 2px 5px;">退款中</span>
            <span v-if="scope.row.status=='1'">已完成</span>
          </template>
        </el-table-column>
        <el-table-column label="完成时间" prop="done_date"></el-table-column>
        <el-table-column label="备注" prop="memo"></el-table-column>
      </el-table>
    </el-dialog>
</template>

<script>
  export default{
    data(){
      return{
        tableData:[],
        dialogVisible:false
      }
    },
    methods:{
      initByDetailId(did){
        this.axios.post("api/admin/buyexchange/list_by_id",{did:did}).then(res=>{
          if(res.status==200 && res.data.code==1){
              this.tableData=res.data.data;
          }
           console.log(res);
        })
      },
      initData(buycode){
        this.axios.post("api/admin/buyexchange/list_by_buycode",{buycode:buycode}).then(res=>{
          if(res.status==200 && res.data.code==1){
              this.tableData=res.data.data;
          }
           console.log(res);
        })
      }
    }
  }
</script>

<style>
</style>
